exports.search_video_list = function(req, res) {

	//获取restful参数
	var restfulParams = req.routeInfo.restfulParams;

	//最终结果
	var resultData = {};

	//任务流创建
	async.waterfall([
		//获取视频的基本信息
		function(cb) {
			R.SEND_HTTP(
				req, {
					url: CORE_APIConfig.coreAPI.searchOrganizationVideo + "/ov_oid/" + restfulParams.ov_oid + "/sort_order/ov_order-desc",
					method: 'GET',
				},
				function(err, data) {
					if(err) {
						return cb(err, data);
					}
					resultData.videoCourseData = data.data;
					cb();
				}
			);
		},
		//获取报名数量
		function(cb) {
			var tasks = [];
			//循环节点列表
			resultData.videoCourseData.forEach(function(item, i) {
				//创建每一个插入任务
				tasks.push(function(cb) {
					R.SEND_HTTP(
						req, {
							url: CORE_APIConfig.coreAPI.searchOrganizationVideoBuyRecord + '/ovbr_ovid/' + item.ov_id,
							method: 'GET'
						},
						function(err, data) {
							if(err) {
								return cb(err, data);
							}
							resultData.videoCourseData[i].apply_num = data.data.length;
							cb();
						}
					);

				});

			});

			async.waterfall(tasks, cb);

		},


	], function(err, result) {

		//返回最终拼接结果
		RES.response(res, true, resultData);

	});

}